package com.yyy.dm.consumer.controller;

import com.yyy.dm.CommonResponse;
import com.yyy.dm.consumer.service.ItemCommentConsumerService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/item")
public class ItemCommentConsumerController {
    @Resource
    private ItemCommentConsumerService itemCommentConsumerService;
    //查询商品评论
    @PostMapping("/desc/getComments")
    public CommonResponse getComments(@RequestBody Map<String,Long> param){
        return itemCommentConsumerService.getComments(param.get("id"));
    }
    //添加商品评论
    @PostMapping("/permission/desc/postComments")
    public CommonResponse postComments(@RequestBody Map<String,String> param){
        return itemCommentConsumerService.postComments(param);
    }
}
